package main

import (
	"log"
	"net"

	"github.com/vishvananda/netlink"
)

func main() {
	subnetString := "192.168.33.1/24"
	ip, subnet, _ := net.ParseCIDR(subnetString)
	log.Println(ip.String())
	leadingOne, totalBit := subnet.Mask.Size()
	// 返回是 24和32;前导1数量和总bit数
	log.Println(leadingOne, totalBit)

	ipnet, _ := netlink.ParseIPNet("192.168.2.0/24")
	log.Println(ipnet.IP.String())
}
